#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements
                                                        
#include "textures.inc"    // pre-defined scene elements
#include "shapes.inc"
#include "glass.inc"
#include "metals.inc"
#include "woods.inc"   




#declare ROAD_WIDTH = 7;
#declare ROUNADABOUT_INTERNAL_RADIUS = 3;
#declare ROUNADABOUT_RADIUS = ROUNADABOUT_INTERNAL_RADIUS + ROAD_WIDTH;
#declare ROAD_HEIGHT = 0.1;
#declare GROUND_HEIGHT = 0;
#declare DISTANCE_BETWEEN_PARALLEL_ROADS = 1;
#declare HALF_DISTANCE_BETWEEN_PARALLEL_ROADS = DISTANCE_BETWEEN_PARALLEL_ROADS/2;
#declare SCENE_EXTENT = 500;







#declare LandArea = texture {
      pigment {
        agate
        turbulence 1
        lambda 1.5
        omega .8
        octaves 8
        color_map {
          [0.00 color rgb <.5, .25, .15>]
          [0.33 color rgb <.5, .5, .4>]
          [0.86 color rgb <.5, .2, .1>]
          [1.00 color rgb <.5, .25, .15>]
        }
      }
    }



#declare building1 = box{ <3,3,3>, <0,0,0>
     pigment {Yellow}
   finish{
     //reflection {0.1}
     ambient 0.3
     diffuse 0.6
   }
}                  
  

  
plane { <0, 1, 0>, 0
   texture {LandArea}
 }


object{
building1
translate -x*(ROUNADABOUT_RADIUS + ROAD_WIDTH) - z*(ROUNADABOUT_RADIUS + ROAD_WIDTH + 2)
}

object{
building1
translate -x*(ROUNADABOUT_RADIUS + ROAD_WIDTH) - z*(ROUNADABOUT_RADIUS + 3* ROAD_WIDTH + 2)
}



difference {
    torus {
      ROUNADABOUT_RADIUS, ROAD_WIDTH/2
    }
    box { <-SCENE_EXTENT, SCENE_EXTENT, -SCENE_EXTENT>, <SCENE_EXTENT, ROAD_HEIGHT, SCENE_EXTENT> }
    box { <-SCENE_EXTENT, -SCENE_EXTENT, -SCENE_EXTENT>, <SCENE_EXTENT, GROUND_HEIGHT, SCENE_EXTENT> }
    pigment { Gray50 }
}


#declare roads = union{

box { <-SCENE_EXTENT, ROAD_HEIGHT, ROAD_WIDTH>, <SCENE_EXTENT, GROUND_HEIGHT, HALF_DISTANCE_BETWEEN_PARALLEL_ROADS> }

box { <-SCENE_EXTENT, ROAD_HEIGHT, -HALF_DISTANCE_BETWEEN_PARALLEL_ROADS>, <SCENE_EXTENT, GROUND_HEIGHT, -ROAD_WIDTH> }

box { <ROAD_WIDTH, ROAD_HEIGHT, -SCENE_EXTENT>, <HALF_DISTANCE_BETWEEN_PARALLEL_ROADS, GROUND_HEIGHT, SCENE_EXTENT> }

box { <-HALF_DISTANCE_BETWEEN_PARALLEL_ROADS, ROAD_HEIGHT, -SCENE_EXTENT>, <-ROAD_WIDTH, GROUND_HEIGHT, SCENE_EXTENT> }

}

difference{
   object {roads}
   sphere{<0,0,0>,ROUNADABOUT_RADIUS}
   pigment { color Gray50 }
}



light_source { <2, 4, -3> color White}


// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color rgb 1.0       // light's color
  area_light
  <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  circular            // make the shape of the light circular
  orient              // orient light
  translate <40, 80, -40>   // <x y z> position of light
}


    
    
    
    
    
// sun ---------------------------------------------------------------
light_source{<1500,2500,-2500> color White}
// sky ---------------------------------------------------------------
plane{<0,1,0>,1 hollow  // 
      
        texture{ pigment {color rgb<0.1,0.35,0.8>*0.8}
                          finish {ambient 1  diffuse 0}
               } // end texture 1

        texture{ pigment{ bozo turbulence 0.75
                          octaves 6  omega 0.7 lambda 2 
                          color_map {
                          [0.0  color rgb <0.95, 0.95, 0.95> ]
                          [0.05  color rgb <1, 1, 1>*1.25 ]
                          [0.15 color rgb <0.85, 0.85, 0.85> ]
                          [0.55 color rgbt <1, 1, 1, 1>*1 ]
                          [1.0 color rgbt <1, 1, 1, 1>*1 ]
                          } // end color_map 
                         translate< 3, 0,-1>
                         scale <0.3, 0.4, 0.2>*3
                        } // end pigment
                 finish {ambient 1 diffuse 0}
               } // end texture 2

      scale 10000}  
// fog at the horizon     
fog{distance 300000 color White}

// ground ------------------------------------------------------------
/*plane { <0,1,0>, 0 
        texture{ pigment{color rgb<0.35,0.65,0.0>*0.9}
	         normal {bumps 0.75 scale 0.015}
                 finish {ambient 0.1 diffuse 0.8}
               } // end of texture
      } // end of plane
*/
//--------------------------------------------------------------------

    
    
    
    
    
    
    
    
    